using System.Collections.Generic;
using UnityEngine;

public class RacketButton : MonoBehaviour
{
	public UILabel label;

	public RacketSettings.Racket currentRacket
	{
		get
		{
			List<RacketSettings.Racket> rackets = ScriptableObjectSingleton<RacketSettings>.instance.rackets;
			return rackets[GGPlayerSettings.instance.Model.usedRacket % rackets.Count];
		}
	}

	private void Awake()
	{
		UpdateLabel();
	}

	private void UpdateLabel()
	{
		label.text = GGPlayerSettings.instance.Model.usedRacket.ToString();
	}

	public void OnClick()
	{
		GGPlayerSettings.instance.Model.usedRacket = (GGPlayerSettings.instance.Model.usedRacket + 1) % ScriptableObjectSingleton<RacketSettings>.instance.rackets.Count;
		GGPlayerSettings.instance.Save();
		UpdateLabel();
	}
}
